package com.mathassistant.client.view;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.mathassistant.client.presenter.AboutPresenter.Display;

public class AboutView extends DialogBox implements Display{
	
	private Button buttonClose;
	
	public AboutView() {
		initUI();
	}

	void initUI()
	{
		setWidth("308px");
		setText("Th\u00F4ng Tin");
		
		VerticalPanel verticalPanel = new VerticalPanel();
		setWidget(verticalPanel);
		verticalPanel.setSize("280px", "115px");
		
		Label lblThngTinSinh = new Label("Sinh vi\u00EAn th\u1EF1c hi\u1EC7n :");
		lblThngTinSinh.setStyleName("dlgLogin-title");
		verticalPanel.add(lblThngTinSinh);
		
		HorizontalPanel horizontalPanel = new HorizontalPanel();
		horizontalPanel.setStyleName("dlgLogin-horizontal");
		verticalPanel.add(horizontalPanel);
		horizontalPanel.setWidth("100%");
		
		Label label = new Label("0712178");
		label.setStyleName("dlgAbout-Label");
		horizontalPanel.add(label);
		label.setWidth("50px");
		
		Label lblNguynNgcHa = new Label("Nguy\u1EC5n Ng\u1ECDc H\u00F2a");
		lblNguynNgcHa.setStyleName("dlgAbout-Label");
		horizontalPanel.add(lblNguynNgcHa);
		
		HorizontalPanel horizontalPanel_1 = new HorizontalPanel();
		horizontalPanel_1.setStyleName("dlgLogin-horizontal");
		verticalPanel.add(horizontalPanel_1);
		horizontalPanel_1.setWidth("100%");
		
		Label label_1 = new Label("0712191");
		label_1.setStyleName("dlgAbout-Label");
		horizontalPanel_1.add(label_1);
		label_1.setWidth("50px");
		
		Label lblLPhKhnh = new Label("L\u00EA Ph\u00FA Kh\u00E1nh Huy");
		lblLPhKhnh.setStyleName("dlgAbout-Label");
		horizontalPanel_1.add(lblLPhKhnh);
		
		HorizontalPanel horizontalPanel_2 = new HorizontalPanel();
		horizontalPanel_2.setStyleName("dlgLogin-horizontal");
		verticalPanel.add(horizontalPanel_2);
		horizontalPanel_2.setWidth("100%");
		
		buttonClose = new Button("Tho\u00E1t");
		buttonClose.addStyleName("dlgAbout-button");
		buttonClose.addStyleName("dlgAbout-button");
		horizontalPanel_2.add(buttonClose);
		buttonClose.setWidth("70px");
	}

	@Override
	public HasClickHandlers getCloseButton() {
		// TODO Auto-generated method stub
		return buttonClose;
	}

	@Override
	public void showDialog() {
		// TODO Auto-generated method stub
		this.setAnimationEnabled(true);
		this.setGlassEnabled(true);
		this.center();
		this.buttonClose.setFocus(true);
		this.show();
	}
	
	@Override
	public void hideDialog() {
		// TODO Auto-generated method stub
		this.hide(true);
	}
	
	@Override
	public Widget asWidget() {
		// TODO Auto-generated method stub
		return this;
	}
}
